<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<%@ taglib uri="/WEB-INF/vectrics.tld" prefix="vectrics" %>

<%@ page import="org.vectrics.recruiter.RecruitStart" %>
<%@ page import="org.vectrics.recruiter.RecruitServiceLocator" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="java.util.Collections" %>
<%@ page import="java.util.List" %>
<%@ page import="org.vectrics.location.Location" %>
<%@ page import="org.vectrics.recruiter.job.JobStatusType" %>

<%
  List<JobStatusType> allStatus = RecruitServiceLocator.getJobProvider().findJobStatus();
 
  for (JobStatusType s : allStatus) {
	  s.setDescription(s.getDescription(request.getLocale()));
  }
  Collections.sort(allStatus);
  request.setAttribute("allStatus", allStatus);
%>

<jsp:useBean id="searchForm" class="org.vectrics.recruiter.struts.JobSearchForm" scope="request"/>

<html:form action="/admin/jobs/index" method="post">
	<table width="100%">
		<tr>
			<td valign="TOP">
				<table width="500">
				<%--  
					<tr>
						<td valign="top">
							<font class="formLabelClass">Search Words</font>
						</td>
						<td valign="top">
							<html:text property="searchPhrase" size="200" styleClass="formEditClass" />
						</td>
					</tr>
				--%>
					<tr>
						<td valign="top">
							<font class="formLabelClass"><bean:message key="prompt.job.reference.id"/></font>
						</td>
						<td valign="top">
							<html:text property="referenceId" size="200" styleClass="formEditClass" />
						</td>
					</tr>
					<tr>
						<td valign="top">
							<font class="formLabelClass"><bean:message key="prompt.job.function"/></font>
						</td>
						<td valign="top">
							<vectrics:jobFunctionCombo property="functionCode" styleClass="formComboClass" any="true"/>
						</td>
					</tr>
					
					<tr>
						<td valign="top">
							<font class="formLabelClass"><bean:message key="prompt.job.location"/></font>
						</td>
						<td valign="top">
							<vectrics:locationCombo 
								property="location" 
								locationType="job.location"
								styleClass="formComboClass"/>
						</td>
					</tr>
					
					<tr>
						<td valign="top">
							<font class="formLabelClass"><bean:message key="prompt.job.posted.time.span"/></font>
						</td>
						
						<td valign="top">
							<html:select property="postedStartTime" styleClass="formComboClass">
								<option selected value="0">All</option>
								<option value="24">Past 1 Day</option>
								<option value="168">Past 7 Days</option>
								<option value="720">Past 1 Month</option>
								<option value="1440">Past 2 Months</option>
								<option value="2160">Past 3 Months</option>
								<option value="2880">Past 4 Months</option>
								<option value="3600">Past 5 Months</option>
								<option value="4320">Past 6 Months</option>
								<option value="6480">Past 9 Months</option>
								<option value="8760">Past 1 Year</option>
								<option value="17520">Past 2 Years</option>
								<option value="43800">Past 5 Years</option>
							</html:select>
						</td>
					</tr>

					<tr>
						<td valign="top">
							<font class="formLabelClass"><bean:message key="prompt.job.created.time.span"/></font>
						</td>
						
						<td valign="top">
							<html:select property="createdStartTime" styleClass="formComboClass">
								<option selected value="0">All</option>
								<option value="24">Past 1 Day</option>
								<option value="168">Past 7 Days</option>
								<option value="720">Past 1 Month</option>
								<option value="1440">Past 2 Months</option>
								<option value="2160">Past 3 Months</option>
								<option value="2880">Past 4 Months</option>
								<option value="3600">Past 5 Months</option>
								<option value="4320">Past 6 Months</option>
								<option value="6480">Past 9 Months</option>
								<option value="8760">Past 1 Year</option>
								<option value="17520">Past 2 Years</option>
								<option value="43800">Past 5 Years</option>
							</html:select>
						</td>
					</tr>
					
					<tr>
						<td valign="TOP" align="left"><font class="formLabelClass"><bean:message key="prompt.job.Status"/></font></td>
						<td valign="top">
							<html:select property="activeStatus" styleClass="formComboClass">
								<html:option value="">  <bean:message key="prompt.job.status.all" /> </html:option>
								<html:options 
					             collection="allStatus"
					             labelProperty="description" 
					             property="code"
					             />
							</html:select>
						</td>
					</tr>
				</table>					
				
				<table width="600">
					<tr>
						<td valign="TOP" align="left" colspan="2">
						    <vectrics:companySelector />						
						</td>
					</tr>
				</table>					
				<table width="500">
					<tr>
						<td valign="TOP" align="left">
							<vectrics:formButton elementId="ok.btn" code="button.ok" phraseCode="button.ok" value="submit" name="submit"/>
						</td>
						<td valign="TOP" align="left">
							<vectrics:formButton elementId="cancel.btn" code="button.cancel" phraseCode="button.cancel" value="cancel" name="cancel"/>
						</td>
					</tr>
				</table>
			</td>
			<td valign="TOP" width="50"></td>
			<td valign="TOP">
				<table></table>
			</td>
		</tr>
	</table>

	
</html:form>
